/**
 * 27/12/2013
 * 
 * Ball
 * 
 * Copyright GPL
 */
package com.jtmproject;

import java.io.Serializable;
import java.util.Random;

import com.badlogic.gdx.math.Vector3;

/**
 * Represents the ball of the game
 * 
 * @author Pello Altadill && Javier Tejedor
 * 
 */
public class Ball implements Serializable{

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 3881586395772130878L;

	//pixels per second
	private float speed = 90f;
	
	private Random random;
	//current position
	private Vector3 currentPosition;
	//current direction
	private Vector3 currentDirection;
	
	/**
	 * constructor.
	 * Sets the position and the direction
	 */
	public Ball(){
		random = new Random();
		//random position to start
		currentPosition = new Vector3(random.nextInt(13) + 1, 3, 0);
		currentDirection = new Vector3(speed, speed, 0);
	}

	/**
	 * returns the current position
	 * @return
	 */
	public Vector3 getCurrentPosition() {
		return currentPosition;
	}

	/**
	 * sets the current position
	 * @param currentPosition
	 */
	public void setCurrentPosition(Vector3 currentPosition) {
		this.currentPosition = currentPosition;
	}

	/**
	 * returns the current direction
	 * @return
	 */
	public Vector3 getCurrentDirection() {
		return currentDirection;
	}

	/**
	 * returns the speed
	 * @return
	 */
	public float getSpeed() {
		return speed;
	}

	/**
	 * it increases speed
	 * @param speed
	 */
	public void addSpeed() {
		this.speed++;
	}

}
